﻿using System;
using System.Web.UI;
using Portal.Data.Entity;
using Portal.Data.Webparts;

public partial class Webparts_Templates_truyen_SearchResult : WebpartControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            var key = Request["key"] ?? "";
            if (key.Length == 0) return;

            var pageindex = Common.GetCurrentPageIndex();
            ltrHeader.Text = string.Format("Kết quả của: {0}", key);

            var books = Book.QuickSearch(key, pageindex);
            Items.DataSource = books;
            Items.DataBind();

            Common.PagingWithouTotalCount(new Control[] { phPagingBottom }, pageindex, books.Count);
        }
    }
}